---@class ProfessionAdditionCalculator:IAttributeCalculator
ProfessionAdditionCalculator = ClientFight.CreateClass("ProfessionAdditionCalculator",nil,ClientFight.IAttributeCalculator)
function ProfessionAdditionCalculator:getType()
    return CalculatorTypeEnum.PROFESSION_ADDITION
end
---获取玩家属性
---@param fight AbstractFight
---@param fighter Fighter
---@param attr BaseAttribute
---@param state BaseState
---@param sign BaseSign
function ProfessionAdditionCalculator:countAttribute(fight, fighter, attr, state, sign)
    if fight.fightType == FightTypeConst.UNION_BOSS_FIGHT then
        return
    end
    local fightTeam = fighter.fightTeam
    for heroType,v in pairs(fightTeam.professionAmountMap) do
        --该职业上场人数
        local battleAmount = v
        local amount = fightTeam.professionAdditionMap[heroType] or 0
        local professionAdditionTemplate = DataManager.getProfessionAdditionTemplate(heroType)
        if professionAdditionTemplate == nil then
            goto continue
        end
        if not continue and professionAdditionTemplate.attributeAddition == nil then
            goto continue
        end
        local multiple = 0
        if not continue then
            multiple = math.min(amount,table.getn(professionAdditionTemplate.attributeAddition))
            if multiple <= 0 then
                goto continue
            end
        end
        local add = professionAdditionTemplate.attributeAddition[multiple - 1]
            if add == nil or table.getn(add) < 1 then
                goto continue
            end
        attr:changeAttribute(add[1],add[2]*battleAmount)
        SkillRoleMgr.savePathFile(string.format("[%s][BUFF_ATT_CAL]team:%s ,%s职业加成 %s属性,`属性值%s",
                fight.frame, fighter.teamIndex, fighter.fighterId, add[1], add[2] * battleAmount));
        ::continue::
    end
end